/*
package com.dylearn.test;

import com.dylearn.serve.rpc.client.Client;
import com.dylearn.serve.rpc.server.HelloService;
import com.dylearn.serve.rpc.server.HelloServiceImpl;
import com.dylearn.serve.rpc.server.IServer;
import com.dylearn.serve.rpc.server.ServerImpl;
import com.dylearn.serve.rpc.socket.IServerSocketCenter;
import com.dylearn.serve.rpc.socket.Server;
import com.dylearn.serve.rpc.socket.ServerCenter;
import com.dylearn.serve.rpc.socket.ServerSocketCenter;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.io.IOException;
import java.net.InetSocketAddress;

@SpringBootTest
public class testRpc {

    */
/**
     * 这里直接进行测试的话是失败的
     *//*


    @Test
    void RPCClientTest() {
        HelloService service = null;
        try {
            service = Client.getRemoteProxyObj(
                    Class.forName("remote.procedure.call.server.HelloService"),
                    new InetSocketAddress("127.0.0.1", 9999));

        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        System.out.println(service.sayHi("zs"));
    }

    @Test
    void RPCServerTest() {
        //开启一个线程
        new Thread(new Runnable() {
            @Override
            public void run() {
                //服务中心
                Server server = new ServerCenter(9999);
                //将HelloService接口及实现类 注册到 服务中心
                server.register(HelloService.class, HelloServiceImpl.class);
                server.start();
            }
        }).start();//start()
    }

    @Test
    void testServer() {

        IServerSocketCenter server = new ServerSocketCenter();
        server.register(IServer.class, ServerImpl.class);
        try {
            server.start();

        } catch (IOException e) {
            e.printStackTrace();
        }

        //开启一个线程
       */
/* new Thread(new Runnable() {
            @Override
            public void run() {
                socketCenter = new ServerSocketCenter();
                socketCenter.register(IServer.class, ServerImpl.class);
                try {
                    socketCenter.start();

                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }).start();//start()*//*


    }
}
*/
